let shouye = document.getElementsByClassName('shouye')[0];
let btm_index = document.getElementsByClassName('btm-index')[0];
let btm_div = btm_index.getElementsByTagName('div');

let arrA = [
    "./img/首页/ic_home_s@2x.png",
    "./img/首页/ic_mall_s@2x.png",
    "./img/首页/ic_neighbour_n@2x (2).png",
    "./img/首页/ic_mine@2x.png"
];
let arrN = [
    "./img/首页/ic_home_s@2x (2).png",
    "./img/首页/ic_mall_n@2x.png",
    "./img/首页/ic_neighbour_n@2x.png",
    "./img/首页/ic_mine_n@2x.png"
]
let mkt = document.getElementsByClassName('mkt')[0];
let conmunity = document.getElementsByClassName('community-app')[0];
let Myhome = document.getElementsByClassName('Myhome-app')[0];
let arr=[shouye,mkt,conmunity,Myhome]

for (let i = 0; i < btm_div.length; i++) {

    btm_div[i].onclick = function () {
        for(let j=0;j<btm_div.length;j++){
            let i = btm_div[j].getElementsByTagName('img')[0];
            i.src = arrN[j];
            arr[j].style = 'display:none';
        }
        let img = this.getElementsByTagName('img')[0];
        
        img.src = arrA[i];
        if(i==1){
            arr[i].style = "display:flex";
        }else{
            arr[i].style = 'display:block'
        }
        
    }
}
